import 'package:json_annotation/json_annotation.dart';
import 'package:play_android/com/zhihaoliang/widget/SlideView.dart';

part 'BannerItem.g.dart';

/// **************************************************************************
/// 首页banner Item的数据
/// **************************************************************************

@JsonSerializable()
class BannerItem implements SlideImp {
  int id;

  String imagePath;

  String title;

  String url;

  String link;

  BannerItem(this.id, this.imagePath, this.title, this.url, this.link);

  factory BannerItem.fromJson(Map<String, dynamic> json) =>
      _$BannerItemFromJson(json);

  Map<String, dynamic> toJson() => _$BannerItemToJson(this);

  @override
  String slideImagePath() {
    return imagePath;
  }

  @override
  String slideTitle() {
    return title;
  }

  @override
  String slideUrl() {
    return url;
  }
}
